import { GET, POST } from '@/utils/http'
import type { initParams } from '/#/request'
enum Api {
  // 获取渠道信息
  'RequestChannel' = 'visitor/initChannel',
  // 高频关键词
  'RequestHotKey' = 'visitor/findlssue/getByConfigId',
  // 初始化机器人
  'RequestInitRobot' = 'robot/initChat',
  // 机器人对话
  'RequestChatRobot' = 'robot/chat',
  // 销毁机器人
  'RequestDestroyRobot' = 'robot/destoryRobot',
  // 发送验证码
  'RequestSendCode' = 'SMSCertification/sendSMS',
  // 公告信息
  'RequestNotice' = 'visitor/notice',
  // 评价
  'RequestEvaluate' = 'satisfaction/updateSatisfaction',
  // 创建会话
  'RequestCreateSession' = 'visitor/initMeetingInfo',
  // 强认证
  'RequestStrongAuth' = 'SMSCertification/verifyCode',
  // 自助服务
  'RequestSelfService' = 'visitor/listSelfService',
  // 猜你想问
  'RequestGuess' = 'visitor/listWantAsk',
  // 文件上传系统配置
  'RequestUploadConfig' = 'fs/config/sysConfig',
  // 文件上传文件配置
  'RequestUploadFileConfig' = 'fs/config/query',
  // 上传文件
  'RequestUploadFile' = 'fs/file/upload',
  // 工作时间检查
  'RequestWorkTime' = 'visitor/checkWorkTime',
  // 获取websocket连接地址
  'RequestWebsocketBaseUrl' = 'csplat/vispars',
  // 获取转接菜单
  'RequestTransferMenu' = 'visitor/getMenuTree',
  // 检查是否有留言消息
  'RequestLeaveMessage' = 'visitor/hasMeetingLeave',
  // 未读消息列表
  'RequestUnreadMessage' = 'visitor/getAgentUnReadEsMoblie',
  // 更新未读消息状态
  'RequestUpdateUnreadMessage' = 'visitor/updateMessageReadByRole',
  // 留言
  'RequestVisitorLeaveMessage' = 'visitor/addVisitorMessage',
  // 历史消息
  'RequestHistoryMessage' = 'visitor/pageEs',
}

export const requestChannel = (params: initParams) => {
  return GET(Api.RequestChannel, params)
}

export const requestHotKey = (params: {
  tenantId: string
  configId: string
}) => {
  return POST(Api.RequestHotKey, params)
}

export const requestNotice = (params: { configId: string }) => {
  return GET(Api.RequestNotice, params)
}
export const requestCreate = (params) => {
  return POST(Api.RequestCreateSession, params)
}
/**
 * 初始化机器人
 */
export const requestInitRobot = (params) => {
  return POST(Api.RequestInitRobot, params)
}
/**
 * 销毁机器人
 */
export const requestDestroyRobot = (params) => {
  return POST(Api.RequestDestroyRobot, params)
}
/**
 * 发送验证码
 */
export const requestSendCode = (params) => {
  return POST(Api.RequestSendCode, params)
}
/**
 * 强认证
 */
export const requestStrongAuth = (params) => {
  return POST(Api.RequestStrongAuth, params)
}
/**
 * 自助服务
 */
export const requestSelfService = (params) => {
  return GET(Api.RequestSelfService, params)
}
/**
 * 猜你想问
 */
export const requestGuess = (params) => {
  return POST(Api.RequestGuess, params)
}
/**
 * 机器人对话
 */
export const requestRobotChat = (params) => {
  return POST(Api.RequestChatRobot, params)
}
/**
 * 文件上传配置
 */
export const requestUploadConfig = () => {
  return GET(Api.RequestUploadConfig)
}
/**
 * 文件上传文件配置
 */
export const requestUploadFileConfig = (params) => {
  return POST(Api.RequestUploadFileConfig, params)
}
/**
 * 上传文件
 */
export const requestUploadFile = (params) => {
  return POST(Api.RequestUploadFile, params, {
    headers: { 'content-type': 'multipart/form-data' },
  })
}

/**
 * 评价
 */
export const requestEvaluate = (params) => {
  return POST(Api.RequestEvaluate, params)
}
/**
 * 工作时间检查
 */
export const requestWorkTime = (params) => {
  return POST(Api.RequestWorkTime, params)
}
/**
 * 获取websocket连接地址
 */
export const requestWebsocketBaseUrl = (params) => {
  return GET(Api.RequestWebsocketBaseUrl, params)
}
/**
 * 获取转接菜单
 */
export const requestTransferMenu = (params) => {
  return POST(Api.RequestTransferMenu, params)
}

/**
 * 检查是否有留言消息
 */
export const requestHasLeaveMessage = (params) => {
  return POST(Api.RequestLeaveMessage, params)
}
/**
 * 未读消息列表
 */
export const requestUnreadMessage = (params) => {
  return GET(Api.RequestUnreadMessage, params)
}

/**
 * 更新未读消息状态
 */
export const requestUpdateUnreadMessage = (params) => {
  return POST(Api.RequestUpdateUnreadMessage, params)
}
/**
 * 留言
 */
export const requestVisitorLeaveMessage = (params) => {
  return POST(Api.RequestVisitorLeaveMessage, params)
}
/**
 * 历史消息
 */
export const requestHistoryMessage = (params) => {
  return POST(Api.RequestHistoryMessage, params)
}
